<?php
/** Copyright 2014 TinPhp Systems, Inc.
 * @author zhangxilian 2013-8-15
 */
if (!defined('IN_TINPHP')) {
    exit('Access Denied');
}

require_once('adminApp.php');

/** 系统管理员 */
class ManageController extends AdminAppController {
	
	public function __construct() {		
        parent::__construct();
	}
 	
 	public function actionDefault(){
 		
 		$page = intval($_REQUEST["p"]) ? $_REQUEST["p"] : 1;
 		$size = 10;
 		
 		$res = array();
 		$accountLogic = $this->Logic('AccountLogic');
 		try{
 			$res = $accountLogic->getAccountList("*", "1=1", "order by id desc", $page, $size);
 			if($res['data']){
 				foreach($res['data'] as $k=>&$v){
 					$v['role'] = $accountLogic->getRoleItem("*","ID=".$v['ROLE_ID']);
 				}
 			}
			$par = array ();
			$res['page'] = page :: listPage($par, $res["count"], $page, $size);
 		}catch(Exception $e){
 			echo $e->getMessage();
 		}
		
		T::$tpl->set("res", $res);
 	}
    /** 添加管理员 */
    public function actionAdd(){
        T::$tplFile = "admin/manage/act";         
        if($_POST['actname']=='save'){
            $this->SaveData($_POST, 'add');
        }       
    }
}//End CLass
?>